<template>
  <!-- 行政复议监督 -->
  <iframe v-if="iframeUrl" id="acceptIframe" :src="iframeUrl" width="100%" height="850vh" scrolling="yes" frameborder="0" />
</template>

  <script>
  import { SFNET_APPKEY, SFNET_SECRETKEY } from '@/store/mutation-types'
  import storage from 'store'
  import { APP_USER, ACCESS_TOKEN } from '@/store/mutation-types.js'
  import { queryTaskidByApplyid } from '@/api/apply/apl_main.js'
  const SFNET_URL = process.env.VUE_APP_SFNET_URL
  export default {
    data () {
      return {
        isQuery: false, // 是否正在查询
        applyid: this.$route.params.applyid,
        matid: this.$route.params.matid,
        pattern: this.$route.params.pattern,
        sfnet_appKey: SFNET_APPKEY,
        sfnet_secretKey: SFNET_SECRETKEY,
        currentUser: storage.get(APP_USER), // 登录人信息
        iframeUrl: null
      }
    },
    created () {
      // console.log('this.$route.params', this.$route.params)
      const token = storage.get(ACCESS_TOKEN)
      if (this.applyid && this.pattern && this.matid) {
        this.iframeUrl = `${SFNET_URL}/approveApplyForm/${this.applyid}/${this.matid}/${this.pattern}/${this.currentUser.userId}/${SFNET_APPKEY}/${SFNET_SECRETKEY}/${token}`
      } else {
        // 新增路由直接跳转，路由无法直接传参，为空则表示为新增的案件
        this.iframeUrl = `${SFNET_URL}/approveApplyForm/add/100000_360100-000201005000-QT-002-02/3/${this.currentUser.userId}/${SFNET_APPKEY}/${SFNET_SECRETKEY}/${token}`
      }
      console.log('iframeUrl', this.iframeUrl)

      try{
        if(this.$route.query.url == '/SuperviseDraft'){
          localStorage.setItem('SuperviseDraft',JSON.stringify(this.$route.query.queryParam))
          localStorage.setItem('SuperviseDraftUrl',JSON.stringify(this.$route.query.url))
          console.log('this.$route.query.SuperviseDraft',this.$route.query.queryParam);
        }
      }catch{
        console.log('路由传参非json格式')
      }
    },

    methods: {},
}
</script>

<style scoped></style>
